{% extends 'bbs/base.html' %}
{% load staticfiles %}
{% block body %}
    <style>
        .main {
            padding-top: 20px;
        }

        .btn {
            margin-top: 10px;
        }
    </style>
    <div class="container">
        {#    {{ topic.topic_title }}#}
        {#    <p>{{ topic.topic_content }}</p>#}
        {#<div class="row">#}

        <div class="row">
            <img src="{% static 'img/bbs/topic_show_logo.jpg' %}" class="img-responsive">
        </div>
        <div class="row main">
            <div class="col-md-6 well">
                <div class="row">
                    <div class="col-md-4 col-md-offset-1">
                        <h4>{{ topic.topic_title }}</h4>
                    </div>

                </div>
                <div class="row">
                    <div class="col-md-8 col-md-offset-1">
                        <p>{{ topic.topic_content }}</p>
                    </div>
                </div>

            </div>
            <div class="col-md-6">
                <div class="row">
                    <div class="col-md-10 col-md-offset-1">
                        <div id="id_post" class="well">
                            <ul class="media-list">
                                {% for post in posts %}
                                    <li class="media">
                                        <div class="media-left">
                                            {#                                            <a href="#">#}
{#                                            <img class="media-object" src="..." alt="...">#}
                                            {#                                            </a>#}
                                            {% if post.post_publisher.portrait %}
                                                <img src="/media/{{ post.post_publisher.portrait }}" class="media-object">
                                            {% else %}
                                                <img src="{% static 'img/bbs/none.jpg' %}" class="media-object">
                                            {% endif %}
                                            {{ form.portrait }}
                                        </div>
                                        <div class="media-body">
                                            <h4 class="media-heading">{{ post.post_publisher.username }}</h4>
                                            <p>{{ post.post_content }}</p>
                                        </div>
                                    </li>
                                {% endfor %}
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-10 col-md-offset-1">
                        <div class="form-group">
                            <textarea id="id_form_post" class="form-control"></textarea>
                            <button id="id_form_push" class="btn btn-primary pull-right">发布</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block foot_js %}
    {#    <script src="{% static 'Validform/demo/js/Validform_v5.3.2.js' %}"></script>#}
    {#    <script src="{% static 'Validform/demo/plugin/datePicker/jquery.datePicker.js' %}"></script>#}
    <script src="{% static 'js/bbs/topic_show.js' %}"></script>
{% endblock %}